<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<c:choose>
<c:when test="${sessionScope.userInfo!=null }">

	<html>
	<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>게시글 쓰기</title>
	<script type="text/javascript">
	function content_submit(){
		var f=document.write_form;	
		f.submit();
	}
	function cancel(){
		var f=document.write_form;
		f.reset();
	}
	</script>
	</head>
	<body>
	<h3>글쓰기</h3> <br>
	  <form action="${initParam.root}buyboard.do" method="post" name="write_form">
	  <input type="hidden" name="command" value="register">
	   <table width="500px" >
	    <tr>
	     <td width="10%">제목</td>
	     <td colspan="3">
	     <input type="text" name="title" maxlength="200" size="50">
	     </td>
	    </tr>
	    <tr>
	     <td width="10%">상품명:</td>
	     <td width="35%"><input type="text" name="goods"></td>
	     <td width="15%">거래지역:</td>
	     <td >
	     <input type="text" name="tradeArea">
	     </td>
	    </tr>
	    <tr>
	     <td colspan="4">
	     <textarea cols="55" rows="15" name="content"></textarea>
	     </td>
	    </tr> 
	    <tr>
	     <td colspan="4" align="center" >
	      <img src="${initParam.root}img/confirm.gif" alt="글입력"  onclick="content_submit()">
	      <a href="" onclick="cancel()"><img src="${initParam.root}img/cancel.gif"></a>      
	     </td>  
	    </tr>
	   </table>
	  </form>
	  </body>
	</html>
</c:when>
<c:otherwise>
	<script type="text/javascript" >
		location.href="${initParam.root}view/index.jsp";
	</script>
</c:otherwise>
</c:choose>